﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IMIS_ERP.Web.Order_Info
{
    public partial class Search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 文本框改变事件：订单号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void txtoiID_TextChanged(object sender, EventArgs e)
        {
            IMIS_ERP.BLL.Order_Info bll = new IMIS_ERP.BLL.Order_Info();
            if (bll.ExistsTask(txtoiID.Text.Trim()))
            {
                lblExist.Text = "";
                btnSave.Enabled = true;
            }
            else
            {
                lblExist.Text = "订单号不存在或者订单没有生成生产任务单！";
                btnSave.Enabled = false;
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            IMIS_ERP.BLL.Order_Info bll = new IMIS_ERP.BLL.Order_Info();
            IMIS_ERP.Model.Order_Info model = bll.GetModel(txtoiID.Text.Trim());
            lblMessage.Text = "订单："+model.oiID+"  的生产状态为："+model.oiStatus;
        }

    }
}